<!--
 * @Author: your name
 * @Date: 2021-07-13 21:48:33
 * @LastEditTime: 2021-07-20 13:00:56
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \练习库e:\72-briup\briupteamproj\src\views\components\News.vue
-->
<template>
  <div class="newes">
    <new
    
    :news="lismsg.list"
    :title="title">
    </new>
  </div>
</template>
<script>
import { get } from '../../utils/request'
import New from './News/New.vue'
import Vue from 'vue'

export default {
  components:{
    New,
  },
  data() {
    return {
      lismsg: {},
      param: {
        page: 1,
        pageSize: 20,
      },
      
      
      title: '公告',
      more: '',
      xiaoyuandian: '',
    }
  },
  methods: {
    // 加载标题
    loadTitle() {
      let url = '/index/findByKey'
      get(url, { name: 'title' }).then((resp) => {
        if (resp.data) {
          this.title = resp.data.val
          // console.log(resp.data)
        }
      })
    },
    // 加载公告数据列表
    loadLisMsg() {
      let url = '/index/article/pageQuery'
      get(url, this.param).then((resp) => {
        this.lismsg = resp.data
        console.log(this.lismsg.list);
      })
    },
  },
  created() {
    this.loadTitle()
    
    this.loadLisMsg()
    
  },
}

// 列表向上滚动
var lis = document.querySelectorAll('.news ul li')
// console.log(lis[0]);
</script>